<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算机资产统计</title>
    {% load staticfiles %}
    <link rel="stylesheet" type="text/css" href={% static "/css/base.css" %}>
    <link rel="stylesheet" type="text/css" href={% static "/css/changelists.css" %}>
    <link rel="stylesheet" type="text/css" href={% static "/css/responsive.css" %}>
</head>
<body>
    <table>
        <div id="navbar">
            <li> <a href="/event_manage/">计算机信息展示</a> </li>
            <li> <a href="#">计算机资产统计</a> </li>
        </div>
            <div>
            <form method="get" action="/Statistical_computer_in/">
                <div>
                    <select name="index_computer">
                        <option value="asset_users">资产使用者</option>
                        <option value="it_number">IT资产编号</option>
                        <option value="seat_number">座位编号</option>
                        <option value="c_network">IP地址</option>
                        <option value="c_cpu">CPU</option>
                        <option value="c_memory">内存</option>
                        <option value="mac_network">MAC地址</option>
                        <option value="c_display">显卡</option>
                        <option value="name">登录名称</option>
                        <option value="computer_name">计算机名</option>
                        <option value="system_type">系统类型</option>
                        <option value="c_time">更新时间</option>
                    </select>
                    <input name="index_name" type="text" placeholder="名称">
                    <button type="submit">搜索</button>
                </div>
            </form>
        </div>
        <div class="row">
            <thead>
                <tr>
                    <th>IP地址</th><th>系统类型</th><th>登录用户</th><th>资产使用者</th><th>座位编号</th><th>IT资产编号</th><th>最后自动登记时间</th><th>是否在线</th>
                </tr>
            </thead>
                {% for computer_status in computer_statuses %}
                    {% if  forloop.counter|get_quyu  %}
                        <tr class="row1">
                            <td>{{ computer_status.c_network }}</td>
                            <td>{{ computer_status.system_type }}</td>
                            <td>{{ computer_status.name }}</td>
                            <td>{{ computer_status.asset_users }}</td>
                            <td>{{ computer_status.seat_number }}</td>
                            <td>{{ computer_status.it_number }}</td>
                            <td>{{ computer_status.c_time }}</td>
                            {% if flag|get_item:computer_status.c_network == 0 %}
                                <td>在线{{ flag|get_item:computer_status.c_network }}</td>
                            {% else %}
                                <td>离线{{ flag|get_item:computer_status.c_network }}</td>
                            {% endif %}
                        </tr>
                    {% else %}
                        <tr class="row2">
                            <td>{{ computer_status.c_network }}</td>
                            <td>{{ computer_status.system_type }}</td>
                            <td>{{ computer_status.name }}</td>
                            <td>{{ computer_status.asset_users }}</td>
                            <td>{{ computer_status.seat_number }}</td>
                            <td>{{ computer_status.it_number }}</td>
                            <td>{{ computer_status.c_time }}</td>
                            {% if flag|get_item:computer_status.c_network == 0 %}
                                <td>在线{{ flag|get_item:computer_status.c_network }}</td>
                            {% else %}
                                <td>离线{{ flag|get_item:computer_status.c_network }}</td>
                            {% endif %}
                        </tr>
                    {% endif %}
                {% endfor %}
        </div>
    </table>
    <p>{{ number }}条数据</p>
</body>
</html>